package com.dy.springbootstudy.second_chapter_web.controller_book_code;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 视图控制器
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

  @Override
  public void addViewControllers(ViewControllerRegistry registry) {
    //这是拦截器，把标记有的 路径 都会在这里被拦截和处理
    registry.addViewController("/book").setViewName("/book/home");
  }

}
